package com.shd.day04;

import java.util.Arrays;
import java.util.stream.Stream;

/**
 * @author S5343
 * @date 2018年7月23日下午9:18:03
 */
public class StreamMatch {
	public static void main(String[] args) {
		Stream<Integer> stream = Arrays.stream(new Integer[] { -11, 2, 34, 5, 6 });
		boolean b = stream.allMatch(i -> i > 0);
		System.out.println(b);// false

		Stream<Integer> stream1 = Arrays.stream(new Integer[] { -11, 2, 34, 5, 6 });
		boolean c = stream1.anyMatch(i -> i > 0);
		System.out.println(c);

		Stream<Integer> stream2 = Arrays.stream(new Integer[] { -11, 2, 34, 5, 6 });
		boolean noneMatch = stream2.noneMatch(i -> i > 100);
		System.out.println(noneMatch);
	}
}
